{include file="header/index" /}
<meta charset="UTF-8">
<style>
	#MenuName {
		color: #333333;
		font-size: 20px;
		font-family: "微软雅黑";
		line-height: 50px;
		color: #1273a3;
	}
	
	.Authority {
		background: #fff;
		/*padding: 10px 15px;
        border-bottom: 1px solid #dcdcdc;*/
		height: 50px;
		margin-bottom: 10px;
		line-height: 50px;
	}
	
	.Authority i {
		float: left;
		margin-top: 14px;
		font-size: 22px;
		margin-right: 15px;
		color: #1273a3;
	}
	
	.content {
		width: 100%;
		overflow: auto;

	}
	/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
	
	::-webkit-scrollbar {
		width: 0px;
		height: 16px;
		background-color: #F5F5F5;
	}
	/*定义滚动条轨道 内阴影+圆角*/
	
	::-webkit-scrollbar-track {
		-webkit-box-shadow: inset 0 0 0px rgba(242, 242, 242, 0);
		border-radius: 10px;
		background-color: #F5F5F5;
	}
	/*定义滑块 内阴影+圆角*/
	
	::-webkit-scrollbar-thumb {
		border-radius: 10px;
		-webkit-box-shadow: inset 0 0 0px rgba(242, 242, 242, 0);
		background-color: #d1d1d1;
	}
	
	.whitebg {
		padding-top: 10px;
	}
</style>

<body>
<input type="hidden" value="" id="gcry">
<input type="hidden" value="" id="gstatus">

<input type="hidden" value="" id="assigned">
<input type="hidden" value="" id="work_order_type">
<input type="hidden" value="" id="work_order_status">
<input type="hidden" value="" id="startUpdateTime">

	<div class="navbar navbar-default nav-top" style="margin-bottom: 0px;">
		<div class="container">
			<!-- Brand and toggle get grouped for better mobile display -->
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="javascript:void(0)bs-example-navbar-collapse-1" aria-expanded="false">
				        <span class="sr-only">Toggle navigation</span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
				        <span class="icon-bar"></span>
				    </button>
				<a class="navbar-brand navbar-logo" href="javascript:void(0)"><img src="__IMG__/logo.png"></a>
			</div>

			<!-- Collect the nav links, forms, and other content for toggling -->
			<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
				<ul class="nav navbar-nav nav-left">
					<?php if(empty(!$menu)){?> {foreach $menu as $key => $val}
					<li>
						{if condition="$val['url'] eq '#'"}
						<a href="javascript:void(0)" target="myFrameName" id="a{$val.id}" data-pid="{$val.id}" onclick="showMenu(this,{$val.id})" data-css="{$val.css}">{$val.title}</a>
						{else /}
						<a href="/{$val.url}" target="myFrameName" id="a{$val.id}" data-pid="{$val.id}" onclick="showMenu(this,{$val.id})" data-css="{$val.css}">{$val.title}</a>
						{/if}
					</li>
					{/foreach}
					<?php }?>
					<!-- 	<li>
								<a href="javascript:void(0)" target="myFrameName">运营中心</a>
							</li>
							<li>
								<a href="javascript:void(0)" target="myFrameName">用户管理</a>
							</li>
							<li>
								<a href="javascript:void(0)" target="myFrameName">合同</a>
							</li>
							<li>
								<a href="javascript:void(0)" target="myFrameName">配件管理</a>
							</li>
							<li>
								<a href="javascript:void(0)" target="myFrameName">系统管理</a>
							</li> -->

				</ul>

				<ul class="nav navbar-nav navbar-right nav-right">
					<li class="dropdown">
						<a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-th"></span><span class="caret"></span></a>
						<ul class="dropdown-menu">
							<li>
								<a href="{:url('index/doindex')}" target="myFrameName">控制台</a>
							</li>
						</ul>
					</li>

					<li>
						<a href="{:url('Announce/index')}" target="myFrameName"><span class="glyphicon glyphicon-volume-down"></span></a>
					</li>
					<li>
						<a href="{:url('Letter/index')}" target="myFrameName"> <span class="glyphicon glyphicon-envelope"></span><span id="lettertips"></span></a>
					</li>
					<li>
						<a href="javascript:void(0)" class="dropdown-toggle head-name" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{$username}<img class="Head_img" src="{:Config('IMAGES_PATH')}{$portrait}"></a>
						<ul class="dropdown-menu">
							<li>
								<a href="{:url('Users/PersonalInformation')}" target="myFrameName" class="navigation_hide">个人资料</a>
							</li>
							<li>
								<a href="{:url('Log/index')}" target="myFrameName" class="navigation_hide">操作日志</a>
							</li>
							{if condition="$is_admin eq 1"}
							<li>
								<a href="{:url('Authgroup/index')}" target="myFrameName">权限分配</a>
							</li>
							{/if}
							<li>
								<a href="javascript:void(0)" target="myFrameName" onclick="loginOut();">退出</a>
							</li>
						</ul>
					</li>
				</ul>
			</div>
			<!-- /.navbar-collapse -->
		</div>
		<!-- /.container-fluid -->
	</div>

	<div class="container Authority mt20 hides">
		<i class="fa fa-battery-full" id="show_class"></i>
		<h2 class="fl" id="MenuName">欢迎你【{$username}】-</h2>
		<ul class="clearfix" style="margin:0px" id="MenuShowList">
			<!-- <li class="fl">
				<a href="/administrative/menu/index" target="myFrameName">管理员管理</a>
			</li>
			<li class="fl">
				<a href="{:url('Menu/Index')}" target="myFrameName">角色管理</a>
			</li>
			<li class="fl">
				<a href="{:url('Menu/Index')}" target="myFrameName">菜单管理</a>
			</li>
			<li class="fl">
				<a href="authorityAssign/userAdministration.html">用户管理</a>
			</li> -->
		</ul>
	</div>
	<div class="content">
		<iframe id="mainFrame" name="myFrameName" src="{:url('operation/index/doindex')}" frameborder="0" scrolling="no" style=" width: 100%; "></iframe>
	</div>

	<script type="text/javascript">
		$(document).ready(function() {
			var height = $(window).height() - 110;
			startInit('mainFrame', height);
			$(".content").css("height", height)
		});

		function current(obj) {
            $('#gcry').val('')
            $('#gstatus').val('')
			$(obj).addClass("current");
			$(obj).siblings().removeClass("current")
		}

		$(".nav-left>li").click(function() {
			$(this).addClass("active");
			$(this).siblings().removeClass("active");
			$(this).parent(".nav-left").next(".nav-right").find("li").removeClass("active");
		})
		$(".nav-right>li").click(function() {
			$(this).addClass("active");
			$(this).siblings().removeClass("active");
			$(this).parent(".nav-right").prevAll(".nav-left").find("li").removeClass("active");
		})

		/**
		 * 查询二级菜单栏
		 */
		function showMenu(obj, id) {
			$.post("{:url('Index/MenuList')}", {
				id: id
			}, function(e) {
				if(e.code == 0) {
					layer.msg(e.msg, {
						icon: 0,
						shade: 0.1
					});
					return false;
				}
				$('.Authority').show();
				$("#MenuName").text($(obj).text());
				$("#show_class").removeClass();
				$("#show_class").addClass($(obj).attr('data-css'));
				
				var str = '';
				$("#MenuShowList").html('');
				$.each(e.data, function(key, val) {
					str += '<li class="fl" onclick="current(this)">';
					str += '<a href="/' + val.url + '" target="myFrameName">' + val.title + '</a>';
					str += '</li>';
				})
				$("#MenuShowList").html(str);
			}, 'json');
		}

		function loginOut() {
			$.post("{:url('Login/loginOut')}", {}, function(e) {
				layer.msg(e.msg, {
					icon: 6,
					time: 2000
				}, function() {
					window.location.href = e.url;
				});
			})
		}

		message_z_tips();

		function message_z_tips() {
			$.get("{:url('Letter/tips')}", function(data) {
				$('#lettertips').html(data.rcount);
			}, 'json');
			setTimeout('message_z_tips()', 5000);
		}
	</script>
</body>

</html>